package com.kye.express.business.jd.shop.model;

import android.os.Parcel;
import android.os.Parcelable;

import com.kye.model.bean.jd.shop.JDGoodsItemBean;

/**
 * @author : Joe
 * @version : 1.0
 * @editor : Joe
 * @created : 29/01/2018
 * @updated : 29/01/2018
 * @description : <Description>
 * @update_reason : <UpdateReason>
 */

public class JDGoodsItemModel implements Parcelable {

    JDGoodsItemBean goodsItemBean;
    private boolean showLeftDivider;

    public boolean isShowLeftDivider() {
        return showLeftDivider;
    }

    public void setShowLeftDivider(boolean showLeftDivider) {
        this.showLeftDivider = showLeftDivider;
    }

    public JDGoodsItemBean getGoodsItemBean() {
        return goodsItemBean;
    }

    public void setGoodsItemBean(JDGoodsItemBean goodsItemBean) {
        this.goodsItemBean = goodsItemBean;
    }

    public JDGoodsItemModel() {
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeParcelable(this.goodsItemBean, flags);
        dest.writeByte(this.showLeftDivider ? (byte) 1 : (byte) 0);
    }

    protected JDGoodsItemModel(Parcel in) {
        this.goodsItemBean = in.readParcelable(JDGoodsItemBean.class.getClassLoader());
        this.showLeftDivider = in.readByte() != 0;
    }

    public static final Creator<JDGoodsItemModel> CREATOR = new Creator<JDGoodsItemModel>() {
        @Override
        public JDGoodsItemModel createFromParcel(Parcel source) {
            return new JDGoodsItemModel(source);
        }

        @Override
        public JDGoodsItemModel[] newArray(int size) {
            return new JDGoodsItemModel[size];
        }
    };
}
